#!usr/bin/node

const http = require('http');

http.createServer((req,res) => {
  console.log('req.method:',req.method);
  switch(req.method) {
    case 'GET':
      res.end('GET');
      break;
    case 'POST':
      res.end('POST');
      break;
    case 'DELETE':
      res.end('DELETE');
      break;
    case 'PUT':
      res.end('PUT');
      break;
    default:
      res.end('request method not support!');
  }
}).listen(8080);
